home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 November
/
Ahoy_Magazine_87-11_1987_Double_L.d64
/
Eueler's Primes
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
437b
|
14 lines
1 rem ==================================
2 rem commodares problem #43-1 :
3 print" [197]uler's [208]rimes"
4 rem solution by
5 rem paul vaughan
6 rem ==================================
7 rem a.b=4294967297
8 rem a=4294967... b=.......297
10 a=4294967 : b=297 : for n=7 to 65537 step 2
11 h=int(a/n) : rh=a-n*h : lr=1000*rh+b
12 l=lr/n : rl=lr-n*int(l) :if rl=0 then 14
13 next n : end
14 print"1+2^(2^5)=4294967297=" mid$(str$(n),2)"*"mid$(str$(h),2)mid$(str$(l),2)